package com.gds.wiki.cloud.memberCenter.server.config;

import org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * 描述
 *
 * @author Y.S.K
 * @date 2018/7/18 15:09
 */
@Configuration
public class ShardingDataSourceConfig {

    @Autowired
    SpringBootConfiguration springBootConfiguration;

    @Bean
    public DataSource masterSlaveDataSource() throws SQLException {
       return springBootConfiguration.dataSource();
    }

}
